/* rcoqty.i - DETERMINE OPEN QUANTITY FOR A SCHEDULED ORDER LINE              */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.3.1.2 $                                                         */
/*V8:ConvertMode=NoConvert                                                    */
/* REVISION: 8.6      LAST MODIFIED: 09/20/96     BY: TSI *K005*              */
/* REVISION: 8.6      LAST MODIFIED: 05/20/98     BY: *K1Q4* Alfred Tan       */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00     BY: *N0KP* Mark Brown       */
/* $Revision: 1.3.1.2 $    BY: Jean Miller            DATE: 03/22/01 ECO: *P008*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

if so_cum_acct then
assign
   cum_all_qty       = cum_all_qty + schd_all_qty
   cum_net_req       = max(schd_cum_qty - sod_cum_qty[1],0)
   cum_net_req       = if not so_bump_all
                       then
                          max(cum_net_req - cum_all_qty,0)
                       else
                          cum_net_req
   net_req           = cum_net_req - prior_cum_net_req
   prior_cum_net_req = cum_net_req.

else
assign
   net_req = schd_discr_qty - schd_ship_qty
   net_req = if not so_bump_all then
                net_req - schd_all_qty
             else
                net_req
   net_req = if (schd_discr_qty - net_req) / schd_discr_qty * 100 >= ship_cmplt
             then
                0
             else
                net_req.
